<?php
namespace application\site\controllers;

use mz\controllers\SiteController;
use Yii;

class ErrorController extends SiteController
{
    public $layout = false;
    public function actionIndex()
    {
        $e = Yii::$app->errorHandler->exception;
        if ($e !== null)
        {
            $code = $e->getCode();
            $name = 'Error';
            $message = $e->getMessage();
            $data = [ 'code' => $code, 'name'=>$name, 'message'=> $message ];

            return $this->render('index', $data);
        }
    }
}
